﻿#ifndef APPLICATIONITEM_H
#define APPLICATIONITEM_H

#include <QWidget>
#include <QDebug>
#include <QPainter>
#include <QPainterPath>
#include <QFile>
namespace Ui {
class ApplicationItem;
}

class ApplicationItem : public QWidget
{
    Q_OBJECT

public:
    explicit ApplicationItem(const QString &email,const QString &username,const QString &content,QWidget *parent = nullptr);
    ~ApplicationItem();
    void updateStatus();
    QString getEmail();
    QString getUsername();
signals:
    void agreeApplication(const QString &email,const QString &username);
public slots:
    void setTemporaryImage(QObject* sender,const QString &email,const QByteArray &data);
private:
    Ui::ApplicationItem *ui;
    QString email;
    bool isEmailMatched(const QString &email);
    void setHeadImageLabelPixmap(const QPixmap &pixmap);
    QImage squareImageToCircle(const QImage &squareImage);
    void updateHeadImg();
};

#endif // APPLICATIONITEM_H
